Skip to content

Configure Dependabot to monitor @github/copilot npm updates#94

Merged
edburns merged 1 commit intomainfrom
edburns/dd-2955542-dependabot
Apr 24, 2026
Merged

Configure Dependabot to monitor @github/copilot npm updates#94
edburns merged 1 commit intomainfrom
edburns/dd-2955542-dependabot

Conversation

@edburns
Copy link
Copy Markdown
Collaborator

@edburns edburns commented Apr 24, 2026

  • Add npm ecosystem entry for scripts/codegen/ directory
  • Filter to @github/copilot package only (daily schedule)
  • Add github-actions ecosystem entry for workflow updates (weekly)

Related to #93 .

Before the change?

  • There is no agentic way to keep the generated code in sync with the reference implementation.

After the change?

  • This way exists.

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • mvn spotless:apply has been run to format the code
  • mvn clean verify passes locally

Does this introduce a breaking change?

  • Yes
  • No infrastructure only.

- Add npm ecosystem entry for scripts/codegen/ directory
- Filter to @github/copilot package only (daily schedule)
- Add github-actions ecosystem entry for workflow updates (weekly)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 18:11
@edburns
Copy link
Copy Markdown
Collaborator Author

edburns commented Apr 24, 2026

@copilot

I already did this locally.

Ran terminal command: pip3 install --quiet check-jsonschema && check-jsonschema --schemafile /tmp/dependabot-2.0-schema.json .github/dependabot.yml
Completed with input: pip3 install --quiet check-jsonschema && check-jsonschema --schemafile /tmp/dependabot-2.0-schema.json .github/dependabot.yml

Ran terminal command: /Users/edburns/Library/Python/3.9/bin/check-jsonschema --schemafile /tmp/dependabot-2.0-schema.json .github/dependabot.yml

Validation passed. The dependabot.yml is valid against the official schema. Safe to merge to main.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Configures Dependabot to automatically track upstream dependency updates relevant to keeping the SDK’s generated code and workflows in sync with the reference implementation.

Changes:

  • Add a Dependabot npm update configuration for /scripts/codegen on a daily schedule.
  • Restrict npm updates to the @github/copilot package and limit open PRs to 1.
  • Add a weekly Dependabot configuration for github-actions updates.
Show a summary per file
File Description
.github/dependabot.yml Adds Dependabot update entries for npm codegen dependencies and GitHub Actions workflow versions.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@edburns edburns merged commit 0e810e1 into main Apr 24, 2026
11 of 12 checks passed
Copilot stopped work on behalf of edburns due to an error April 24, 2026 18:13
edburns added a commit to edburns/copilot-sdk-java that referenced this pull request Apr 24, 2026
…ma changes

---

## Summary

Updates the Java code generator and handwritten SDK/test code to handle the
`@github/copilot` 1.0.35 schema format, which changed from inline nested type
definitions to `$ref` references pointing to `#/definitions/` entries. Without
this fix, regenerated types were missing fields and the build failed.

75 files changed, 616 insertions(+), 1836 deletions(-)

## Changes

### Code generator (`scripts/codegen/java.ts`)

- Added `resolveRef()` helper to dereference `$ref` pointers in JSON schemas.
- Added `pendingStandaloneTypes` map to collect types referenced via `$ref` and
  generate them as top-level Java files instead of nested records.
- Added `generatePendingStandaloneTypes()`, `generateStandaloneEnum()`, and
  `generateStandaloneRecord()` to emit the new standalone types.
- Updated all property/field generation paths to resolve `$ref` before
  inspecting type, enum, or nested-object shapes.

### Regenerated files (`src/generated/java/`)

- ~65 generated source files updated — nested inner records/enums replaced by
  standalone types (e.g. `McpServer`, `Plugin`, `Skill`, `Tool`, `Model`,
  `AccountQuotaSnapshot`, `DiscoveredMcpServer`, `UIElicitationSchema`,
  `UIElicitationResponseAction`, `ModelCapabilitiesOverride`, etc.).
- Several numeric fields changed from `double` to `Long` (`PingResult`,
  `SessionShellExecParams`, model capability limits).
- New RPC API class `ServerMcpConfigApi` and `SessionPermissionsApi` added.

### Handwritten source (`CopilotSession.java`)

- Updated all type references from old nested types to new standalone types
  (e.g. `SessionMcpListResultServersItem` → `McpServer`).

### Test files (5 files)

- **`GeneratedRpcRecordsCoverageTest.java`** — Replaced all nested type
  references with standalone types; fixed `double` → `Long` constructors.
- **`GeneratedEventTypesCoverageTest.java`** — Updated event type name set.
- **`GeneratedRpcApiCoverageTest.java`** — Updated `workspace` → `workspaces`,
  added `SessionLogLevel`, new API classes.
- **`RpcWrappersTest.java`** — `session.workspace` → `session.workspaces`.
- **`SessionEventDeserializationTest.java`** — Updated JSON keys for
  `compactionTokensUsed` (`input` → `inputTokens`, `output` → `outputTokens`,
  `cachedInput` → `cacheReadTokens`).

### Dependency bump

- `@github/copilot` 1.0.24 → 1.0.35 in `scripts/codegen/package.json`.
- **`.github/workflows/update-copilot-dependency.yml`** — After codegen and PR creation, `mvn verify` is run. On failure, the agentic fix workflow is triggered. Includes a polling loop that waits for the fix to complete and runs a final verification.

## Design

The pipeline follows a two-workflow pattern:

1. **Trigger workflows** (`codegen-check.yml`, `update-copilot-dependency.yml`) detect failures and dispatch the agentic fix.
2. **Fix workflow** (`codegen-agentic-fix.lock.yml`) runs under gh-aw guardrails with scoped permissions, network firewall, and MCP gateway. It checks out the branch, reproduces the failure, applies fixes to handwritten code only, and pushes via `push-to-pull-request-branch` safe-output.

Key constraints enforced on the agent:
- Never modify `src/generated/java/`, `pom.xml`, `scripts/codegen/`, or `.github/`
- Maximum 3 fix attempts before escalating via PR comment
- Must run `mvn spotless:apply` before committing
- Only pushes if `mvn verify` passes

## Testing

- All workflow files pass `actionlint` with zero errors
- The `codegen-agentic-fix.lock.yml` was successfully compiled by `gh aw compile v0.68.3`
- End-to-end testing will occur when this PR and github#94 are both merged — Dependabot PR github#99 (bump `@github/copilot` 1.0.24 → 1.0.35) already exists and its Codegen Check is failing as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants